import axiosInstance from "../axiosInstance";

const userInfo = {
    // 登陆
    checkLogin({
        zh, password
    }) {
        return axiosInstance.post(
            "/userInfo/checkLogin", {
            zh, password
        }
        )
    },
    // 注册
    add({ nickName, user_sex, user_phone, user_email, user_photo, password }) {
        return axiosInstance.post("/userInfo/add", {
            nickName, user_sex, user_phone, user_email, user_photo, password
        })

    },
    // 上传照片
    uploadUserPhoto(file) {
        let formData = new FormData()
        formData.append("user_photo", file)
        return axiosInstance.post("/userInfo/uploadUserPhoto", formData, {
            headers: {
                //设置请求方式
                "Content-Type": "multipart/form-data"
            }
        })

    }
}
export default userInfo